﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListPhoto.ascx.cs" Inherits="Admin.Controls.News.ListPhoto" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="~/Controls/Thumbnail/Thumbnail.ascx" TagName="Thumb" TagPrefix="t" %>
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
<!--[if !IE]>start sidebar module<![endif]-->
<div class="sidebar_module">
	<div class="title_wrapper">
		<h3>Ảnh</h3>
	</div>
	<div class="gallery">
		<!--[if !IE]>start gallery inner<![endif]-->
		<div class="gallery_inner clearfix">
			<asp:Repeater ID="rptListPhoto" runat="server">
			<ItemTemplate>
			<!--[if !IE]>start product<![endif]-->
			<dl class="product">
				<dt>
					<a target="_blank" href="<%#Eval("Image_Url") %>">
					    <t:Thumb ID="BigThumb" OrigionalImage=<%#Eval("Image_Url") %> ThumbHeight="79" ThumbWidth="66" ThumbFolder="~/Thumbs" ErrorImage="~/images/noimage.jpg" runat="server" />
					</a>
				</dt>
				<dd>
					<ul>
						<li>
						    <asp:LinkButton CssClass="delete_product" CommandArgument=<%#Eval("Image_ID") %> runat="server" ID="btDelete" OnCommand="btDelete_Commanded"></asp:LinkButton>
						</li>
					</ul>
				</dd>
			</dl>
			<!--[if !IE]>end product<![endif]-->
			</ItemTemplate>
			</asp:Repeater>
			<div class="add_new">
			    <div>
			        <asp:TextBox ID="txtPhotoPath" Width="140" runat="server"></asp:TextBox>
			        <span class="button blue_button search_button"><span><span><em><span class="button_ico"></span>Chọn ảnh</em></span></span><asp:Button ID="btChoosePhoto" Text="Chọn ảnh" OnClientClick="OpenFileExplorerDialog(); return false;" runat="server" /></span>
    			</div>
    			<span class="button orange_button"><span><span>Thêm</span></span><asp:Button ID="btAddPhoto" OnClick="btAddPhoto_Clicked" Text="Thêm" runat="server" /></span>
			</div>
		</div>
		<!--[if !IE]>end gallery inner<![endif]-->
	</div>
</div>
<!--[if !IE]>end sidebar module<![endif]-->
</telerik:RadAjaxPanel>
<telerik:RadWindow runat="server" Width="850px" Height="560px" VisibleStatusbar="false"
        ShowContentDuringLoad="false" NavigateUrl="~/FilePicker.aspx" ID="ExplorerWindow1"
        Modal="true" Behaviors="Close,Move">
</telerik:RadWindow>

<script type="text/javascript">
function OpenFileExplorerDialog() {
    var wnd = $find('<asp:Literal ID="ltrWindow" runat="server"></asp:Literal>');
    wnd.show();
}


//This function is called from a code declared on the Explorer.aspx page
function OnFileSelected(fileSelected) {
    var textbox = document.getElementById('<asp:Literal ID="ltrTextBox" runat="server"></asp:Literal>');
    textbox.value = fileSelected;
}
</script>